In a Graphical User Interface (GUI), when a window has more displayable contents than can be displayed within the visible area of the window, only a portion of the contents is displayed on the window. A scrolling operation is then typically used for a user to view different portions of the contents in the limited visible area of the window. For example, a user can use a scroll bar to scroll the window to see a different portion of the contents. Other user interactions can also cause scrolling in the window. For example, auto scrolling may occur when the user drags an item to a location near (or on) a scroll bar or a border of the window so that the user can select a desirable location for dropping the dragged item.
FIG. 2 illustrates a buffered window system. In a buffered window system, applications draw contents for their windows in the window buffers; and the window system combines the images of the corresponding windows buffered in window buffers into a frame buffer to display the windows on the screen. For example, application software 201 draws content into window buffer 215, which is typically allocated from system memory 211 (e.g., volatile RAM 105 in FIG. 1). When the size of the window is changed (for example when it is enlarged), a new window buffer is allocated from the system memory to replace the old one in order to accommodate the window of the new size. Frame buffer 221 contains data for the screen image of the windows that are displayed on the screen of display device 205. When the window for application software 201 is moved on the screen, the content in the window is not changed; and the application software does not have to update window buffer 215. The window system copies the data in the window buffer to the correct position in frame buffer 221 to display the window in the new location on the screen. When the window is partially covered by other windows, a portion of data in window buffer 215 is copied onto the frame buffer to display the corresponding portion of the window that is visible. Frame buffer 221 is typically under control of graphics hardware 203 (e.g., graphics/video card, or display controller 108 as shown in FIG. 1), which controls the display of the windows on the screen of display device 205 using the data in the frame buffer.
Thus, in a buffered window system, operations for creating the contents in windows are separated from operations for composing a screen image from images of windows for different applications. Applications create (or update) images of the windows (contents for the windows) in window buffers; and the window system composes a screen image from the images of the windows in the window buffers. The window buffers are independent from the frame buffer.
In a non-buffered window system, an application draws content directly into the frame buffer. For example, when a user moves a top window to reveal a portion of a bottom window, the application for the bottom window must draw the revealed portion. When a window is scrolled, graphics hardware can be used to scroll the content in the frame buffer to update a portion of the window; and the corresponding application can then draw other portions of the window to update the image of the window on the frame buffer. Since graphics hardware can scroll the frame buffer much faster than the application redraws the corresponding portion, using graphics hardware to scroll can accelerate the scrolling operation.
FIGS. 3-4 show a scenario to scroll a window in a non-buffered window system. In FIG. 3, an application draws the image of window 303 directly on frame buffer 301. Areas 309 (A1) and 307 (A2) are shown in window 303. When cursor 305 pulls down thumb 311 of scroll bar 313 (e.g., in response to when a user presses and holds down a mouse button and moves the mouse while the cursor is over the thumb), window 303 is scrolled upward. When cursor 305 is moved to the position of cursor 405 in FIG. 4, scroll bar area 413 and thumb 411 are redrawn to indicate the size and the position of the visible portion of the contents in window 403 with respect to the entire contents. Area A2 is scrolled from the position of area 307 in FIG. 3 to the position indicated by area 407 in FIG. 4; and area 409 (A3) is revealed. Thus, after graphics hardware moves (scrolls) the data in frame buffer 301 for area A2, the corresponding application redraws area A3 (409) so it can be displayed, as shown in FIG. 4.
To scroll a window in a buffered window system, the window buffer is updated when the application scrolls the window. The change is buffered into the window buffer until the window flush occurs, which is an operation to synchronize the frame buffer with the window buffer in order to present the image of the window on the screen. Typically, the window system copies the data from the window buffer to the frame buffer to synchronize the frame buffer with the window buffer. After the synchronization operation, the effect of the scrolling operation is visible on the screen.